.TH "Vision::ImageCallback" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Vision::ImageCallback \- 
.PP
\fBImageCallback\fP class used to register for image events.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <imagecallback.h>\fP
.PP
Inherited by \fBVision::Detector\fP, and \fBVision::VisionPlatform\fP.
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef std::set< \fBVision::ImageCallback\fP * > \fBImageCallbackSet\fP"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "IplImage * \fBInputImage\fP ()"
.br
.ti -1c
.RI "\fBImageCallback\fP ()"
.br
.RI "\fIDefault constructor. \fP"
.ti -1c
.RI "\fB~ImageCallback\fP ()"
.br
.RI "\fIDefault destructor. \fP"
.ti -1c
.RI "void \fBsetup\fP ()"
.br
.RI "\fIPerforms default class setups. \fP"
.ti -1c
.RI "void \fBupdate\fP ()"
.br
.RI "\fIPerforms image \fBImageCallback\fP processing on image file sources and updates the frames. \fP"
.ti -1c
.RI "void \fBdraw\fP ()"
.br
.RI "\fIOUTDATED: Draws images unto canvas. \fP"
.ti -1c
.RI "void \fBkeyPressed\fP (int key)"
.br
.RI "\fIHandles OFXGui. \fP"
.ti -1c
.RI "void \fBmouseMoved\fP (int x, int y)"
.br
.RI "\fIFunction called when the mouse is moved. \fP"
.ti -1c
.RI "void \fBmouseDragged\fP (int x, int y, int button)"
.br
.RI "\fIFunction called when the mouse is dragged. \fP"
.ti -1c
.RI "void \fBmousePressed\fP (int eventType, int x, int y, int flags, void *param)"
.br
.RI "\fIFunction called when the mouse is pressed. \fP"
.ti -1c
.RI "void \fBmouseReleased\fP ()"
.br
.RI "\fIFunction called when the mouse is released. \fP"
.ti -1c
.RI "void \fBAllocateColorImage\fP (IplImage **inputImage)"
.br
.RI "\fIAllocates space for color images. \fP"
.ti -1c
.RI "void \fBAllocateColorImage\fP (IplImage **inputImage, CvSize imageSize)"
.br
.RI "\fIAllocates space for color images with a given size. \fP"
.ti -1c
.RI "void \fBAllocateColorImageBGR\fP (IplImage **inputImage)"
.br
.RI "\fIAllocates space for color images in BGR space. \fP"
.ti -1c
.RI "void \fBAllocateColorImageBGR\fP (IplImage **inputImage, CvSize imageSize)"
.br
.RI "\fIAllocates space for color images with a given size in BGR. \fP"
.ti -1c
.RI "void \fBAllocateGrayscaleImage\fP (IplImage **inputImage)"
.br
.RI "\fIAllocates space for grayscale images. \fP"
.ti -1c
.RI "void \fBAllocateGrayscaleImage\fP (IplImage **inputImage, CvSize imageSize)"
.br
.RI "\fIAllocates space for grayscale images with a given size. \fP"
.ti -1c
.RI "unsigned int \fBBottomBorder\fP () const "
.br
.ti -1c
.RI "void \fBDisplayRectangles\fP (const CvSeq *rectSeq, const unsigned int xCoor, const unsigned int yCoor, const double scaleFactor=1.0)"
.br
.RI "\fIReturns the y-coordinate of the frame's bottom border. \fP"
.ti -1c
.RI "void \fBErodeAndDilateImage\fP (IplImage *inputImage, IplImage *outputImage)"
.br
.RI "\fIPerforms an erosion and dilation operation on an image (Also known as opening). \fP"
.ti -1c
.RI "unsigned long \fBFrameArea\fP () const "
.br
.ti -1c
.RI "unsigned int \fBFrameHeight\fP () const "
.br
.ti -1c
.RI "unsigned int \fBFrameWidth\fP () const "
.br
.RI "\fIHeight of each displayed frame. \fP"
.ti -1c
.RI "bool \fBIsSelected\fP () const "
.br
.RI "\fIWidth of each displayed frame. \fP"
.ti -1c
.RI "unsigned int \fBLeftBorder\fP () const "
.br
.RI "\fIReturns true if the module is selected. \fP"
.ti -1c
.RI "virtual void \fBProcessImage\fP (void *args)=0"
.br
.RI "\fIReturns the x-coordinate of the frame's left border. \fP"
.ti -1c
.RI "bool \fBRectanglesEnables\fP () const "
.br
.ti -1c
.RI "int \fBRegisterImageCallback\fP (\fBVision::ImageCallback\fP *cb)"
.br
.RI "\fIReturns true when rectangles will be drawn to the output image from the contour object. \fP"
.ti -1c
.RI "int \fBRemoveImageCallback\fP (\fBVision::ImageCallback\fP *cb)"
.br
.RI "\fIRemove a registered \fBImageCallback\fP. \fP"
.ti -1c
.RI "unsigned int \fBRightBorder\fP () const "
.br
.ti -1c
.RI "void \fBRunImageCallbacks\fP (void *args)"
.br
.RI "\fIReturns the x-coordinate of the frame's right border. \fP"
.ti -1c
.RI "double \fBScaleFactor\fP () const "
.br
.ti -1c
.RI "void \fBScaleImages\fP (const double ScaleFactor)"
.br
.RI "\fIReturns the scale factor. \fP"
.ti -1c
.RI "void \fBSelectModule\fP ()"
.br
.RI "\fIPerforms events related to module selection. \fP"
.ti -1c
.RI "void \fBThresholdGrayscaleImage\fP (IplImage *inputImage, int thresholdValue, bool Invert)"
.br
.RI "\fIPerforms a threshold on a grayscale image. \fP"
.ti -1c
.RI "unsigned int \fBTopBorder\fP () const "
.br
.ti -1c
.RI "const char * \fBWindowName\fP ()"
.br
.RI "\fIReturns the y-coordinate of the frame's top border. \fP"
.in -1c
.SS "Public Attributes"

.in +1c
.ti -1c
.RI "CvFont \fBmFrameFont\fP"
.br
.RI "\fIDefault writing font for frames. \fP"
.ti -1c
.RI "CvMemStorage * \fBmStorage\fP"
.br
.RI "\fIExpandable memory mStorage. \fP"
.ti -1c
.RI "CvSeq * \fBobjSeq\fP"
.br
.RI "\fIList of detected objects. \fP"
.ti -1c
.RI "IplImage * \fBmInputImage\fP"
.br
.ti -1c
.RI "IplImage * \fBmBackgroundBinary\fP"
.br
.RI "\fICurrent video frame scaled background in binary. \fP"
.ti -1c
.RI "IplImage * \fBmBlueChannelImage\fP"
.br
.RI "\fICurrent video frame red channel. \fP"
.ti -1c
.RI "IplImage * \fBmGrayscaleImage\fP"
.br
.RI "\fICurrent video frame in grayscale format. \fP"
.ti -1c
.RI "IplImage * \fBmGreenChannelImage\fP"
.br
.RI "\fICurrent video frame red channel. \fP"
.ti -1c
.RI "IplImage * \fBmForegroundBinary\fP"
.br
.RI "\fICurrent video frame scaled foreground in binary. \fP"
.ti -1c
.RI "IplImage * \fBmOutputColorImage\fP"
.br
.RI "\fIOutput color image of \fBImageCallback\fP transformation on input image. \fP"
.ti -1c
.RI "IplImage * \fBmOutputMaskImage\fP"
.br
.RI "\fIOutput mask of \fBImageCallback\fP transformation on input image. \fP"
.ti -1c
.RI "IplImage * \fBmRedChannelImage\fP"
.br
.RI "\fICurrent video frame red channel. \fP"
.ti -1c
.RI "IplImage * \fBmThresholdBinary\fP"
.br
.RI "\fIThreshold binary image using morphology operations. \fP"
.ti -1c
.RI "IplImage * \fBmVotingGrayImage\fP"
.br
.RI "\fIVoting grayscale image. \fP"
.ti -1c
.RI "ImageCallbackSet \fBmImageCallbacks\fP"
.br
.RI "\fISet of all ImageCallbacks to run when message received. \fP"
.ti -1c
.RI "CxUtils::Mutex \fBmImageCallbackMutex\fP"
.br
.RI "\fI\fBImageCallback\fP mutex for processing delegates. \fP"
.ti -1c
.RI "\fBVision::VideoPlayer\fP * \fBmVideoPlayer\fP"
.br
.RI "\fIPerforms frame rendering. \fP"
.ti -1c
.RI "std::vector< CvSeq * > \fBmTemplateBarrelContours\fP"
.br
.RI "\fITemplate contours used for matching shapes and hu moments. \fP"
.ti -1c
.RI "std::vector< CvMemStorage * > \fBmTemplateBarrelMemory\fP"
.br
.RI "\fITemplate contour memory objects. \fP"
.ti -1c
.RI "std::vector< CvSeq * > \fBmTemplateConeContours\fP"
.br
.RI "\fITemplate contours used for matching shapes and hu moments. \fP"
.ti -1c
.RI "std::vector< CvMemStorage * > \fBmTemplateConeMemory\fP"
.br
.RI "\fITemplate contour memory objects. \fP"
.ti -1c
.RI "std::vector< CvSeq * > \fBmTemplateBarricadeContours\fP"
.br
.RI "\fITemplate contours used for matching shapes and hu moments. \fP"
.ti -1c
.RI "std::vector< CvMemStorage * > \fBmTemplateBarricadeMemory\fP"
.br
.RI "\fITemplate contour memory objects. \fP"
.ti -1c
.RI "volatile bool \fBmEnableImageCallback\fP"
.br
.ti -1c
.RI "volatile bool \fBmEnableOutputDisplay\fP"
.br
.ti -1c
.RI "volatile bool \fBmEnableRectangles\fP"
.br
.RI "\fIEnables or disables rectangle output. \fP"
.ti -1c
.RI "unsigned int \fBmFrameNumber\fP"
.br
.ti -1c
.RI "void * \fBmParent\fP"
.br
.RI "\fIPointer to parent object.. \fP"
.ti -1c
.RI "unsigned int \fBmXCoordinate\fP"
.br
.RI "\fIX coordinate location of frame on screen. \fP"
.ti -1c
.RI "unsigned int \fBmYCoordinate\fP"
.br
.RI "\fIY coordinate location of frame on screen. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBAllocateImageCallbackImages\fP ()"
.br
.RI "\fIInitializes \fBImageCallback\fP images. \fP"
.ti -1c
.RI "void \fBCannyEdges\fP (IplImage *inputImage, IplImage *outputImage, double threshold1, double threshold2)"
.br
.RI "\fIDetects edges using Canny edge detector. \fP"
.ti -1c
.RI "void \fBGetRectangles\fP (const CvSeq *rectSeq, const double scaleFactor)"
.br
.RI "\fIPlaces the rectangles into the object's mRectangles vector. \fP"
.ti -1c
.RI "void \fBHarrisEdges\fP (IplImage *inputImage, IplImage *outputImage)"
.br
.RI "\fIPerforms Harris edge detection on image. \fP"
.ti -1c
.RI "void \fBHoughLines\fP (IplImage *inputImage, IplImage *outputImage, int cv_method, double dRho=1, double dTheta=CV_PI/180, int threshold=10, double param1=0, double param2=0)"
.br
.RI "\fIPerforms and draws the hough lines into an image. \fP"
.ti -1c
.RI "unsigned int \fBLoadSIFTDatabaseFeatures\fP (string directoryPattern)"
.br
.RI "\fILoads a set of SIFT features for comparison and caching. \fP"
.ti -1c
.RI "bool \fBSIFTFindInDatabase\fP (IplImage *inputImage, string &fileName, double &cfValue)"
.br
.RI "\fIFinds the file name of the closes SIFT match to the image provided. \fP"
.ti -1c
.RI "unsigned int \fBSIFTMatch\fP (IplImage *img1, IplImage *img2)"
.br
.RI "\fIUses SIFT to match images. \fP"
.ti -1c
.RI "void \fBSIFTMatchObjectFound\fP (vector< CvRect > rectangles, IplImage *outputImage)"
.br
.ti -1c
.RI "void \fBResetSIFTDatabaseFeatures\fP ()"
.br
.RI "\fIRemoves features loaded from image database. \fP"
.ti -1c
.RI "void \fBVoteOnResults\fP ()"
.br
.RI "\fICollects votes from images. \fP"
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "CxUtils::Thread * \fBcbThread\fP"
.br
.ti -1c
.RI "long \fBmChronologicalVotingThreshold\fP"
.br
.RI "\fIUsed to describe the voting window for the presence image by frame number. \fP"
.ti -1c
.RI "CxUtils::Mutex \fBmDataMutex\fP"
.br
.RI "\fIMutex used to access data members, with the exception of images. \fP"
.ti -1c
.RI "unsigned int \fBmDelayTime\fP"
.br
.RI "\fIDelay added between frames. \fP"
.ti -1c
.RI "CxUtils::Mutex \fBmImageMutex\fP"
.br
.ti -1c
.RI "volatile bool \fBmIsSelected\fP"
.br
.RI "\fITrue if module is selected. \fP"
.ti -1c
.RI "CvSize \fBmFrameSize\fP"
.br
.ti -1c
.RI "const char * \fBOutputVideo\fP"
.br
.RI "\fIOutput window name. \fP"
.ti -1c
.RI "vector< CvRect > \fBmRectangles\fP"
.br
.RI "\fIVector to store areas of interest discovered. \fP"
.ti -1c
.RI "char \fBmReportStr\fP [1024]"
.br
.RI "\fIString to output to screen on frame. \fP"
.ti -1c
.RI "volatile bool \fBmQuitAnalyzing\fP"
.br
.RI "\fIUsed to stop analysis threads from running. \fP"
.ti -1c
.RI "double \fBmScaleFactor\fP"
.br
.RI "\fIscale factor by which to transform images. \fP"
.ti -1c
.RI "map< string, struct \fBfeature\fP * > \fBmDatabaseFeatures\fP"
.br
.RI "\fIMap of image database features. \fP"
.ti -1c
.RI "map< string, int > \fBmDatabaseFeaturesFound\fP"
.br
.RI "\fIMap of image database \fBfeature\fP counts. \fP"
.in -1c
.SH "Detailed Description"
.PP 
\fBImageCallback\fP class used to register for image events. 
.SH "Member Function Documentation"
.PP 
.SS "void ImageCallback::AllocateImageCallbackImages ()\fC [protected]\fP"
.PP
Initializes \fBImageCallback\fP images. Allocates space for \fBImageCallback\fP images. 
.SS "void ImageCallback::CannyEdges (IplImage * inputImage, IplImage * outputImage, double threshold1, double threshold2)\fC [protected]\fP"
.PP
Detects edges using Canny edge detector. Detects Canny edges and draws them unto output image. Images must be grayscale.
.PP
\fBParameters:\fP
.RS 4
\fIinputImage\fP Image to calculate edges from. 
.br
\fIoutputImage\fP Image to draw edges into. 
.br
\fIthreshold1\fP threshold1 in cvCanny method. 
.br
\fIthreshold2\fP threshold2 in cvCanny method. 
.RE
.PP

.SS "void ImageCallback::DisplayRectangles (const CvSeq * rectSeq, const unsigned int xCoor, const unsigned int yCoor, const double scaleFactor = \fC1.0\fP)"
.PP
Returns the y-coordinate of the frame's bottom border. Draw rectangle from rectangle point sequence.
.PP
Draws rectangle unto screen.
.PP
\fBParameters:\fP
.RS 4
\fIrectSeq\fP Rectangle point sequence. 
.br
\fIxCoor\fP x coordinate of frame. 
.br
\fIyCoor\fP y coordinate of frame. 
.br
\fIscaleFactor\fP factor to scale rectangle by to match image. 
.RE
.PP

.SS "void ImageCallback::ErodeAndDilateImage (IplImage * inputImage, IplImage * outputImage)"
.PP
Performs an erosion and dilation operation on an image (Also known as opening). Performs an erosion and dilation operation on an image.
.PP
\fBParameters:\fP
.RS 4
\fIinputImage\fP Image to erode and dilate. 
.br
\fIoutputImage\fP Destination image for operation. 
.RE
.PP

.SS "void ImageCallback::GetRectangles (const CvSeq * rectSeq, const double scaleFactor)\fC [protected]\fP"
.PP
Places the rectangles into the object's mRectangles vector. Places rectangles found into object's mRectangles vector.
.PP
\fBParameters:\fP
.RS 4
\fIrectSeq\fP Sequence object containing information on rectangle shape and location. 
.br
\fIscaleFactor\fP Factor to scale rectangles by to match image. 
.RE
.PP

.SS "void ImageCallback::HarrisEdges (IplImage * inputImage, IplImage * outputImage)\fC [protected]\fP"
.PP
Performs Harris edge detection on image. Constructs GUI preferences for object.
.PP
Performs harris edge detection on image 
.PP
\fBParameters:\fP
.RS 4
\fIinputImage\fP 8-bit image to detect edges on. 
.br
\fIoutputImage\fP 8-bit image to store edges on. 
.RE
.PP

.SS "void ImageCallback::HoughLines (IplImage * inputImage, IplImage * outputImage, int cv_method, double dRho = \fC1\fP, double dTheta = \fCCV_PI/180\fP, int threshold = \fC10\fP, double param1 = \fC0\fP, double param2 = \fC0\fP)\fC [protected]\fP"
.PP
Performs and draws the hough lines into an image. \fBParameters:\fP
.RS 4
\fIinputImage\fP 8-bit image to detect edges on. 
.br
\fIoutputImage\fP 8-bit image to store edges on. 
.br
\fIcv_method\fP CV_HOUGH_STANDARD or CV_HOUGH_PROBABILISTIC or CV_HOUGH_MULTI_SCALE 
.br
\fIdRho\fP Distance resolution in pixel-related units. 
.br
\fIdTheta\fP Angle resolution measured in radians. 
.br
\fIthresholdThreshold\fP parameter. A line is returned by the function if the corresponding accumulator value is greater than threshold. 
.br
\fIparam1\fP For classical Hough transform it is not used (0). For probabilistic Hough transform it is the minimum line length. For multi-scale Hough transform it is divisor for distance resolution dRho. (The coarse distance resolution will be dRho and the accurate resolution will be (dRho / param1)). 
.br
\fIparam2\fP For classical Hough transform it is not used (0). For probabilistic Hough transform it is the maximum gap between line segments lieing on the same line to treat them as the single line segment (i.e. to join them). For multi-scale Hough transform it is divisor for angle resolution dTheta. (The coarse angle resolution will be dTheta and the accurate resolution will be (dTheta / param2)). 
.RE
.PP

.SS "void ImageCallback::keyPressed (int key)"
.PP
Handles OFXGui. \fBParameters:\fP
.RS 4
\fIparameterId\fP Id of GUI object 
.br
\fItask\fP Id of task to perform 
.br
\fIdata\fP Pointer to data 
.br
\fIlength\fP Length of data
.RE
.PP
Functioned called when a key is pressed.. 
.PP
Reimplemented in \fBVision::BlobDetector\fP, \fBVision::EdgeDetector\fP, \fBVision::FaceDetector\fP, \fBVision::LaneLines\fP, \fBVision::VPBackgroundBinary\fP, \fBVision::VPForegroundBinary\fP, \fBVision::VPGrayscale\fP, \fBVision::VPThreshold\fP, and \fBVision::VisionPlatform\fP.
.SS "unsigned int ImageCallback::LoadSIFTDatabaseFeatures (string directoryPattern)\fC [protected]\fP"
.PP
Loads a set of SIFT features for comparison and caching. Loads and updates SIFT features from a directory.
.PP
\fBParameters:\fP
.RS 4
\fIdirectoryPattern\fP Directory path for image database of the form <Path>\\*.<ext>
.RE
.PP
\fBReturns:\fP
.RS 4
Number of images found. 
.RE
.PP

.SS "void ImageCallback::mousePressed (int eventType, int x, int y, int flags, void * param)"
.PP
Function called when the mouse is pressed. \fBParameters:\fP
.RS 4
\fIx\fP X coordinate of screen selected. 
.br
\fIy\fP Y coordinate of screen selected. /////////////////////////////////////////////////////////////////////////// 
.RE
.PP

.PP
Reimplemented in \fBVision::VisionPlatform\fP.
.SS "int ImageCallback::RegisterImageCallback (\fBVision::ImageCallback\fP * cb)"
.PP
Returns true when rectangles will be drawn to the output image from the contour object. Register a \fBImageCallback\fP to be done everytime a message is received.
.PP
You can register multiple ImageCallbacks if desired.
.PP
\fBParameters:\fP
.RS 4
\fIcb\fP \fBMessage\fP \fBImageCallback\fP to perform when image is received.
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on failure. 
.RE
.PP

.SS "int ImageCallback::RemoveImageCallback (\fBVision::ImageCallback\fP * cb)"
.PP
Remove a registered \fBImageCallback\fP. \fBParameters:\fP
.RS 4
\fIcb\fP Image \fBImageCallback\fP pointer.
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on failure. 
.RE
.PP

.SS "void ImageCallback::RunImageCallbacks (void * args)"
.PP
Returns the x-coordinate of the frame's right border. Run ImageCallbacks.
.PP
Runs ImageCallbacks.
.PP
\fBParameters:\fP
.RS 4
\fIargs.\fP Arguments to pass to the \fBImageCallback\fP functions. 
.RE
.PP

.SS "void ImageCallback::ScaleImages (const double ScaleFactor)"
.PP
Returns the scale factor. Scales object images by a factor.
.PP
Scale images by scale factor.
.PP
\fBParameters:\fP
.RS 4
\fIScaleFactor\fP Scaling factor. 
.RE
.PP

.SS "void ImageCallback::SelectModule ()"
.PP
Performs events related to module selection. Performs events related to module activation after selection. 
.PP
< Kakhi color #1 
.SS "bool ImageCallback::SIFTFindInDatabase (IplImage * inputImage, string & fileName, double & cfValue)\fC [protected]\fP"
.PP
Finds the file name of the closes SIFT match to the image provided. \fBParameters:\fP
.RS 4
\fIinputImage\fP Image to match against database. 
.br
\fIfileName\fP String in which to store the file name of the closest match. 
.br
\fIcfValue\fP Confidence factor value of returned match.
.RE
.PP
\fBReturns:\fP
.RS 4
Returns true if a match has been found, false otherwise. 
.RE
.PP

.SS "unsigned int ImageCallback::SIFTMatch (IplImage * img1, IplImage * img2)\fC [protected]\fP"
.PP
Uses SIFT to match images. Compares two images using SIFT and finds matching features. Based on Rob Hess's algorithm.
.PP
\fBParameters:\fP
.RS 4
\fIimg1\fP First image to match against. 
.br
\fIimg2\fP Image to match. 
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the number of matching features. 
.RE
.PP

.SS "void ImageCallback::ThresholdGrayscaleImage (IplImage * inputImage, int thresholdValue, bool Invert)"
.PP
Performs a threshold on a grayscale image. Applies a binary threshold to a grayscale image based on a given value and stores the results in that image.
.PP
\fBParameters:\fP
.RS 4
\fIinputImage\fP The image to threshold. This is also the destination image. 
.br
\fIthresholdValue\fP The value to use as threshold. 
.br
\fIInvert\fP When true, it applies an inverted binary operation. 
.RE
.PP

.SS "void ImageCallback::VoteOnResults ()\fC [protected]\fP"
.PP
Collects votes from images. Collects \fBImageCallback\fP votes for the presence of an object in an image into a single 'presence image'. 
.PP
< Input image.
.PP
< Low threshold.
.PP
< High threshold, in this case the binary image.
.PP
< Destination image. 

.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
